package com.m1.tzolkin.model.wheels;

public class WheelPosition implements IWheelPosition {
	
	// ATTRIBUTS
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -1764798224558759171L;
	private final WheelEnum wheel;
	private final int position;
	
	// CONSTRUCTEUR
	
	public WheelPosition(WheelEnum w, int p) {
		if (w == null || p < 0) {
			throw new IllegalArgumentException();
		}
		wheel = w;
		position = p;
	}
	
	// REQUETES

	@Override
	public WheelEnum getWheel() {
		return wheel;
	}

	@Override
	public int getPosition() {
		return position;
	}
	
	@Override
	public String toString() {
		return wheel.name() + " " + position;
	}
	
	// COMMANDES

	@Override
	public boolean equals(IWheelPosition p) {
		return p != null
				&& p.getWheel().equals(wheel)
				&& p.getPosition() == position;
	}

}
